﻿<UserControl x:Class="OI.Views.MashupDataView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions">
    
    <Grid x:Name="LayoutRoot">

        <!--NO DATASETS-->
        <TextBlock Text="no datasets selected" Style="{StaticResource PageTitle}" 
                   Visibility="{Binding AreDatasetsAvailable, Converter={StaticResource BoolToVisibility}, ConverterParameter='inverse'}"
                   VerticalAlignment="Center" HorizontalAlignment="Center"/>
        
        <sdk:TabControl x:Name="Tabs" FontSize="16" HorizontalContentAlignment="Stretch" 
                        VerticalContentAlignment="Stretch"
                        HorizontalAlignment="Left" VerticalAlignment="Top" TabStripPlacement="Top" Margin="2">            
            <sdk:TabControl.Resources>
                <Style x:Key="OITabItemStyle" TargetType="sdk:TabItem">
                    <Setter Property="IsTabStop" Value="False"/>
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="BorderBrush" Value="#FF808080"/>
                    <Setter Property="BorderThickness" Value="1"/>
                    <Setter Property="Padding" Value="6,2,6,2"/>
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="MinWidth" Value="5"/>
                    <Setter Property="MinHeight" Value="5"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="sdk:TabItem">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="0"/>
                                                <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver"/>
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal"/>
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="BorderTop">
                                                        <SplineColorKeyFrame KeyTime="0" Value="{StaticResource ThemeColor}"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="GradientTop">
                                                        <SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="GradientTop">
                                                        <SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="GradientTop">
                                                        <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    
                                                    <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusVisualTop">
                                                        <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualTopSelected">
                                                        <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualTopUnSelected">
                                                        <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                   
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="SelectionStates">
                                            <VisualState x:Name="Unselected"/>
                                            <VisualState x:Name="Selected"/>
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="FocusStates">
                                            <VisualState x:Name="Focused">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisualTop">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Unfocused">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisualElement">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>

                                        <VisualStateGroup x:Name="CloseButtonVSG">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition/>
                                            </VisualStateGroup.Transitions>

                                            <VisualState x:Name="HighlightState">
                                                <Storyboard>
                                                    <ColorAnimation Duration="0" To="#90000000" Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" 
                                                                    Storyboard.TargetName="closeEllipse"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="NormalState">
                                                <Storyboard>
                                                    <ColorAnimation Duration="0" To="#60000000" Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" 
                                                                    Storyboard.TargetName="closeEllipse"/>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>

                                    </VisualStateManager.VisualStateGroups>
                                    <Grid x:Name="TemplateTopSelected" Visibility="Collapsed" Canvas.ZIndex="1">
                                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" 
										CornerRadius="3,3,0,0" Margin="-2,-2,-2,0">
                                            <Border BorderBrush="#FFFFFFFF" BorderThickness="1" CornerRadius="1,1,0,0">
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                        <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                        <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                        <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                        <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                                <Grid>
                                                    <Rectangle Fill="#FFFFFFFF" Margin="0,0,0,-2"/>
                                                    <StackPanel Orientation="Horizontal" Margin="{TemplateBinding Padding}" 
                                                                VerticalAlignment="{TemplateBinding VerticalAlignment}">
                                                        
	                                                    <ContentControl x:Name="HeaderTopSelected" FontFamily="Segoe UI"
														Cursor="{TemplateBinding Cursor}" Foreground="{TemplateBinding Foreground}" 
														FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Left" IsTabStop="False" 
														VerticalAlignment="Center"/>
														
														<Grid VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4,0,-8,0"
                                                              Micro:Message.Attach="[Event MouseLeftButtonDown] = [Action CloseSelectedTab()]">
                                                            <i:Interaction.Triggers>
                                                                <i:EventTrigger EventName="MouseEnter">
                                                                    <ei:GoToStateAction StateName="HighlightState"/>
                                                                </i:EventTrigger>
                                                                <i:EventTrigger EventName="MouseLeave">
                                                                    <ei:GoToStateAction StateName="NormalState"/>
                                                                </i:EventTrigger>
                                                                <i:EventTrigger EventName="MouseLeftButtonDown">
                                                                    <ei:GoToStateAction StateName="NormalState"/>
                                                                </i:EventTrigger>
                                                            </i:Interaction.Triggers>
                                                            <Ellipse x:Name="closeEllipse" Height="16" Width="16" Stroke="#60000000" StrokeThickness="1.5" Fill="Transparent"/>
									                        <Path Data="M 6,6 10,10 8,8 10,6 6,10 8,8 6,6 " Stroke="#60000000" 
															StrokeThickness="1.5" StrokeEndLineCap="Round" StrokeLineJoin="Round"/>
									                    </Grid>
													</StackPanel>
                                                </Grid>
                                            </Border>
                                        </Border>
                                        <Border x:Name="FocusVisualTop" BorderBrush="#FF808080" BorderThickness="1,1,1,0" CornerRadius="3,3,0,0" IsHitTestVisible="false" Margin="-2,-2,-2,0" Visibility="Collapsed"/>
                                        <Border x:Name="DisabledVisualTopSelected" Background="#8CFFFFFF" CornerRadius="3,3,0,0" IsHitTestVisible="false" Margin="-2,-2,-2,0" Opacity="0"/>
                                    </Grid>
                                    <Grid x:Name="TemplateTopUnselected" Visibility="Collapsed">
                                        <Border x:Name="BorderTop" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" 
										CornerRadius="3,3,0,0">
                                            <Border x:Name="GradientTop" BorderBrush="#FFFFFFFF" BorderThickness="1" CornerRadius="1,1,0,0">
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                        <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                        <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                        <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                        <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                                <Grid>
                                                    <ContentControl x:Name="HeaderTopUnselected" FontFamily="Segoe UI"
													Cursor="{TemplateBinding Cursor}" Foreground="{TemplateBinding Foreground}" 
													FontSize="{TemplateBinding FontSize}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" IsTabStop="False" 
													Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
                                                </Grid>
                                            </Border>
                                        </Border>
                                        <Border x:Name="DisabledVisualTopUnSelected" Background="#8CFFFFFF" CornerRadius="3,3,0,0" IsHitTestVisible="false" Opacity="0"/>
                                    </Grid>
                                    
                                    <Border x:Name="FocusVisualElement" BorderBrush="#FF808080" BorderThickness="1" CornerRadius="3,3,0,0" IsHitTestVisible="false" Margin="-1" Visibility="Collapsed"/>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </sdk:TabControl.Resources>
        </sdk:TabControl>
    </Grid>
</UserControl>
